const {ccclass, property} = cc._decorator;

// 创建敌人
@ccclass
export default class emenyCreate extends cc.Component {

    // LIFE-CYCLE CALLBACKS:

    @property(cc.Prefab)
    enemy: cc.Prefab

    onLoad () {
        this.schedule(() => {
            // 创建敌人
            // 实例化预设体
            let enemy = cc.instantiate(this.enemy);
            enemy.setParent(this.node);
            
            // 设置敌人位置
            enemy.x = (Math.random() - 0.5) * 430;
            enemy.y = 300;
        }, 3, 3);
    }

    start () {

    }

    // update (dt) {}
}
